const mongoose = require('mongoose')
const model = mongoose.model('heroes', new mongoose.Schema({
    name: String,
    //对于图片保存一般都保存图片地址
    icon: String,
    //注意这个id的写法，不要写错
    parent: { type: mongoose.Schema.Types.ObjectId, ref: 'heroes' },
    //背景图
    banner:String,
    title: String,
    categories: [{ type: mongoose.Schema.Types.ObjectId, ref:'categories'}],
    scores:{
        difficult:{type:Number},
        skills:{type:Number},
        attack:{type:Number},
        survive:{type:Number}
    },
    skills:[{
        icon:{type:String},
        name:{type:String},
        description: { type:String },
        tips:{type:String}
    }],
    items1: [{ type: mongoose.Schema.Types.ObjectId, ref:'items'}],
    items2: [{ type: mongoose.Schema.Types.ObjectId, ref:'items'}],
    usageTips: { type: String },
    battleTips: { type: String },
    teamTips: { type: String },
    partners:[{
        heroes: { type: mongoose.Schema.Types.ObjectId, ref: 'heroes' },
        description: { type: String }
    }]
}))
module.exports = model